<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model的修饰符</title>
</head>
<body>
  <script src="/js/vue.js"></script>
  <div id="app">
      <!-- 1.lazy修饰符  -->
      <!-- 用户按回车或者失去焦点时更新数据 -->
      <input type="text" v-model.lazy="msg">
      <h2>{{msg}}</h2>

      <!-- 2.number修饰符 -->
      <input type="number" v-model.number="age">
      <h2>{{typeof age}}</h2>

      <!-- 3.trim修饰符 -->
      <!-- 真实里面有空格，但是展示的时候没有，想要获取值的时候直接去除前后字符串中的空格，用trim修饰符 -->
      <input type="text" v-model.trim="name">
      <h2>{{name}}</h2>
  </div>
  
  <script>
    let app = new Vue({
      el:"#app",
      data:{ 
        msg:'hello world',
        age:10,
        name:""
      }
    })
  </script> 

</body>
</html>